package com.hbnu.tangyalu;

import java.util.HashSet;
import java.util.Set;

public class HashSetDemo {
    public static void main(String[] args) {
        Set<String> hashSet=new HashSet<>();
        hashSet.add("e2");
        hashSet.add("e3");
        hashSet.add("e1");
        hashSet.add("e4");
        System.out.println(hashSet.size());
        System.out.println(hashSet);
        System.out.println("====================");
        hashSet.stream().forEach(System.out::println);
        System.out.println("--------------------");
        hashSet.stream().iterator().forEachRemaining(System.out::println);
//        for (String s:hashSet) {
//u
//        }
    }
}
